Skip to content

fix(comment): say "waiting on checks" when a hold is not asking anyone to act - #10166

Merged
JSONbored merged 1 commit into
mainfrom
fix/unified-comment-waiting-on-checks
Jul 31, 2026
Merged

fix(comment): say "waiting on checks" when a hold is not asking anyone to act#10166
JSONbored merged 1 commit into
mainfrom
fix/unified-comment-waiting-on-checks

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Closes #10117

#10116 stopped an unstable merge state from summoning a human — no manual-review label, not evicted from the merge train. The unified comment kept rendering that state as "manual review recommended" / "Suggested Action - Manual Review", so the comment and the disposition contradicted each other on the same PR. That is the #5288 contradiction running in reverse.

held has eight sources and they split cleanly

waiting — nobody acts actionable — a person must
GitHub's merge state unsettled (dirty/behind/unstable) guardrail hold
GitHub refused the merge (#9862)
incomplete review (preflight hold)
explicit manual verdict
close verdict, never-closed author
blockers / split review / failures
unverified CI

Only the wording branches. The UnifiedCommentStatus vocabulary is unchanged, so none of the four src readers move and the existing assertions stand.

The predicate lives beside the conditions in deriveUnifiedStatus that produce those cases, and both wording sites (headline and verdict box) read it. Re-deriving "is this actionable?" separately in each is the same drift that let the comment and the disposition disagree to begin with.

The mistake worth recording

An earlier draft also treated ciState !== "passed" as waiting. That vocabulary is passed | failed | unverified with no "pending" member, and failed already returns "blocked" — so the only value that could reach the predicate via CI was unverified, which agent-actions.ts lists as a real manualHoldReason ("CI could not be verified"). That version would have told a maintainer to stand down from a hold that was waiting on them.

tsc rejecting a "pending" literal that does not exist is what surfaced it. The narrowed predicate is now merge-state only, and there is a dedicated regression test asserting unverified CI stays actionable.

Verification

  • typecheck clean; 122 tests in unified-comment.test.ts; full sweep green.
  • Mutation-tested, 4 mutations each caught by ≥1 test:
mutation caught
stop excluding explicit manual/close verdicts
stop excluding actionable ctx holds (guardrail / merge-refusal / preflight)
stop excluding a split or blocking review
revert the headline wording (the original bug)

The first three matter more than the last: being wrongly told to look is noise, being wrongly told not to look is the failure that counts. The predicate is conservative by construction — any state it does not recognise keeps today's Manual Review wording.

…e to act

#10116 stopped an unstable merge state from summoning a human: no manual-review
label, not evicted from the merge train. The unified comment kept rendering
that state as "manual review recommended" / "Suggested Action - Manual Review",
so the comment and the disposition contradicted each other on the same PR --
the #5288 contradiction running the other way.

`held` is reached from eight places and they split cleanly: an unsettled
mergeable state is a WAIT that clears itself, while a guardrail hold, a durable
GitHub merge refusal (#9862), an incomplete review, an explicit manual verdict,
a close verdict on a never-closed author, and a real finding set all need a
person. Only the wording branches, on one predicate defined beside the
conditions in deriveUnifiedStatus that produce those cases -- re-deriving "is
this actionable?" separately in the headline and the verdict box would be the
same drift that let the comment and the disposition disagree to begin with.

The status vocabulary is unchanged, so none of the four src readers or the
existing assertions move.

Deliberately NOT keyed on `ciState !== "passed"`. That vocabulary is
passed|failed|unverified with no "pending" member, and `failed` already returns
"blocked" -- so the only value that could reach the predicate via CI is
`unverified`, which agent-actions.ts lists as a real manualHoldReason ("CI could
not be verified"). An earlier draft included it and would have told a maintainer
to stand down from a hold that was waiting on them; tsc rejecting a "pending"
literal that does not exist is what surfaced it.

Conservative by construction: any state the predicate does not recognise keeps
today's Manual Review wording. Being wrongly told to look is a much smaller
failure than being wrongly told not to.

Closes #10117
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent did not find any vulnerabilities or security issues in this PR.

@loopover-orb

loopover-orb Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Important

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏳ LoopOver is waiting…

LoopOver has seen this pull request and is waiting on CI checks to finish before reviewing it. This comment will update once the review runs.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed · 🟨 Waiting

@JSONbored JSONbored self-assigned this Jul 31, 2026
@JSONbored
JSONbored merged commit ffc4f09 into main Jul 31, 2026
4 checks passed
@JSONbored
JSONbored deleted the fix/unified-comment-waiting-on-checks branch July 31, 2026 10:41
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91.34%. Comparing base (55cbeb9) to head (53f58ab).
⚠️ Report is 6 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/review/unified-comment.ts 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10166      +/-   ##
==========================================
- Coverage   92.21%   91.34%   -0.88%     
==========================================
  Files         931      931              
  Lines      114071   114079       +8     
  Branches    27548    27554       +6     
==========================================
- Hits       105188   104201     -987     
- Misses       7584     8773    +1189     
+ Partials     1299     1105     -194     
Flag Coverage Δ
backend 94.13% <88.88%> (-1.56%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/review/unified-comment.ts 97.86% <88.88%> (-0.31%) ⬇️

... and 3 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chat/comment: the unified comment still says "Manual Review" for a state that no longer summons anyone

1 participant